<template>
	<view>
		<rich-text :nodes="htmlSstring"></rich-text>
		<button @click="handelerup(before)">上一页</button>
		<button @click="handelerdown(after)">下一页</button>
		<button @click="handelerfirst">回到首页</button>
		<button @click="handelerlist">回到列表</button>
		<button @click="handelermy">回到个人中心</button>
	</view>
</template>

<script lang="ts" setup>
	import {
		onLoad
	} from "@dcloudio/uni-app";
	import {
		ref
	} from "vue";
	import ajax from "../util/request"
	const htmlSstring = ref('')
	const before = ref('')
	const after = ref('')
	onLoad((option) => {
		console.log("option=", option);
		ajax("content/queryRow", {
			t_content_pk: option.t_content_pk
		}).then((res: any) => {
			console.log(res);
			if (res.data.status > 0) {
				htmlSstring.value = res.data.result_data.content
				before.value = res.data.before
				after.value = res.data.after
			}

		})
	})

	function handelerup(ite) {
		uni.navigateTo({
			url: "/pages/news/detail?t_content_pk=" + ite.t_content_pk
		})
	}

	function handelerdown(ite) {
		uni.navigateTo({
			url: "/pages/news/detail?t_content_pk=" + ite.t_content_pk
		})
	}

	function handelerfirst() {
		uni.switchTab({
			url: "/pages/index/index"
		})
	}

	function handelerlist() {
		uni.switchTab({
			url: "/pages/news/news",
			
		})
		uni.$emit("opennews",{name:"tom"})

	}
	function handelermy() {
		uni.reLaunch({
			url: "/pages/wo/wo"
		})
	
	}
</script>

<style>

</style>
